package com.ruoyi.hospital.service.consultationInfo.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.consultationInfo.ConsulationRecordMapper;
import com.ruoyi.hospital.domain.consultationInfo.ConsulationRecord;
import com.ruoyi.hospital.service.consultationInfo.IConsulationRecordService;

/**
 * 问诊记录Service业务层处理
 * 
 * @author wendao
 * @date 2025-01-21
 */
@Service
public class ConsulationRecordServiceImpl implements IConsulationRecordService 
{
    @Autowired
    private ConsulationRecordMapper consulationRecordMapper;

    /**
     * 查询问诊记录
     * 
     * @param id 问诊记录主键
     * @return 问诊记录
     */
    @Override
    public ConsulationRecord selectConsulationRecordById(Integer id)
    {
        return consulationRecordMapper.selectConsulationRecordById(id);
    }

    /**
     * 查询问诊记录列表
     * 
     * @param consulationRecord 问诊记录
     * @return 问诊记录
     */
    @Override
    public List<ConsulationRecord> selectConsulationRecordList(ConsulationRecord consulationRecord)
    {
        return consulationRecordMapper.selectConsulationRecordList(consulationRecord);
    }

    /**
     * 新增问诊记录
     * 
     * @param consulationRecord 问诊记录
     * @return 结果
     */
    @Override
    public int insertConsulationRecord(ConsulationRecord consulationRecord)
    {
        consulationRecord.setCreateTime(DateUtils.getNowTimeSecond());
        return consulationRecordMapper.insertConsulationRecord(consulationRecord);
    }

    /**
     * 修改问诊记录
     * 
     * @param consulationRecord 问诊记录
     * @return 结果
     */
    @Override
    public int updateConsulationRecord(ConsulationRecord consulationRecord)
    {
        consulationRecord.setUpdateTime(DateUtils.getNowTimeSecond());
        return consulationRecordMapper.updateConsulationRecord(consulationRecord);
    }

    /**
     * 批量删除问诊记录
     * 
     * @param ids 需要删除的问诊记录主键
     * @return 结果
     */
    @Override
    public int deleteConsulationRecordByIds(Integer[] ids)
    {
        return consulationRecordMapper.deleteConsulationRecordByIds(ids);
    }

    /**
     * 删除问诊记录信息
     * 
     * @param id 问诊记录主键
     * @return 结果
     */
    @Override
    public int deleteConsulationRecordById(Integer id)
    {
        return consulationRecordMapper.deleteConsulationRecordById(id);
    }
}
